import struct

path = './65536bit.txt'
f_r = open(path, 'r', encoding='utf-8')
data = f_r.read()
data_split = data.split()
n = 0
list_dec = data_split

for i in data_split:
    list_dec[n] = int(i, 16)
    n = n + 1

with open('hexBin.bin', 'wb') as fp:
    for x in list_dec:
        a = struct.pack('B', x)
        fp.write(a)

print('done')
